<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>参与竞价</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css">
    <link rel="stylesheet" href="/static/wx/css/reset.css">
    <link rel="stylesheet" href="/static/wx/css/main.css">
    <link rel="stylesheet" href="/static/wx/css/public_main.css">
</head>

<body>
    <div class="page-group">
        <div class="page page-current" id="bid_price">
            <!-- 主内容 -->
            <div class="content">
                <div class="list-block media-list">
                    <ul>
                        <li>
                            <div class="item-content">
                                <div class="item-inner ">
                                    <div class="item-title-row">
                                        <div class="item-title size-65">本人（单位）是否参与竞价拍卖</div>
                                    </div>
                                    <div class="item-subtitle ">
                                        <div class="row">
                                            <div class="col-50"><label class="size-65"><input type="radio" value="1" name="is_join"
                                                                                              {if(isset($info))}{if($info.is_join == 1)}checked="checked"{/if}{/if}> <i></i>
                                                参与
                                            </label></div>
                                            <div class="col-50"><label class="size-65"><input type="radio" name="is_join" value="2"  {if(isset($info))}{if($info.is_join == 2)}checked="checked"{/if}{/if}>
                                                <i></i>
                                                不参与
                                            </label></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner ">
                                    <div class="item-title-row">
                                        <div class="item-title size-65">参与竞价拍卖需缴纳保证金</div>
                                    </div>
                                    <div class="item-subtitle ">
                                        <div class="row">
                                            <div class="col-50"><label class="size-65"><input type="radio" value="1" name="is_promise"
                                                                                              {if(isset($info))}{if($info.is_promise == 1)}checked="checked"{/if}{/if}> <i></i>
                                                申请免交保证金
                                            </label></div>
                                            <div class="col-50"><label class="size-65"><input type="radio" value="2" name="is_promise" {if(isset($info))}{if($info.is_promise == 2)}checked="checked"{/if}{/if}>
                                                <i></i>
                                                缴纳保证金
                                            </label></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="back-price flex size-65" style="width:100%;padding-right:.55rem;">
                                    <div>优先回购价格(总价)</div>
                                    <div>
                                        <div><input type="text" name="back_price" value="{$info.back_price | default=''}" placeholder="价格可以从0元起填" style="font-size: 0.65rem; text-align: right;"></div>
                                    </div>
                                    <div>元</div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="btn-box">
                    <div class="my-btn">
                        <input type="hidden" id="policy_num" value="{$info.policy_num | default = ''}">
                        <input type="hidden" id="i_id" value="{$info.i_id | default = ''}">
                        <span class="active" id="submit">保存</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type='text/javascript' src='/static/wx/lib/sui/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm-extend.min.js' charset='utf-8'></script>
    <script>
        $('#submit').on('touchend',function(){
            var i_id = $('#i_id').val();
            var policy_num = $('#policy_num').val();
            var is_join = $('input[name="is_join"]:checked').val();
            var is_promise = $('input[name="is_promise"]:checked').val();
            var back_price = $('input[name="back_price"]').val();
            if (is_join.length == 0) {
                $.alert('请填写是否参与竞价拍卖');
                return;
            }
            if (is_promise.length == 0) {
                $.alert('请填写是否缴纳保证金');
                return;
            }
            if (back_price.length == 0) {
                $.alert('请填写优先回购价格');
                return;
            }
            $.ajax({
                url:'/wx/insurant/saveBolInfo',
                type:'post',
                dataType:'json',
                data:{
                    'is_join':is_join,
                    'is_promise':is_promise,
                    'back_price':back_price,
                    'i_id':i_id,
                    'now_status':5
                },
                success:function (data) {
                    if(data.code ==200){
                        $.alert('修改成功');
                        window.location.href = '/wx/insurant/returnEdit?policy_num='+policy_num;
                    }else{
                        $.alert(data.msg);
                    }
                }
            });
            //
        });
    </script>
</body>

</html>